package grape.crm.rest.customer.vo;
import grape.base.service.dict.api.IDictService;
import grape.common.rest.vo.BaseIdVo;

import grape.common.service.trans.TransBy;
import grape.common.service.trans.TransField;
import grape.common.service.trans.impl.DatetimeTransServiceImpl;
import grape.crm.rest.customerbelong.vo.CustomerBelongVo;
import grape.crm.service.company.api.ICompanyService;
import grape.crm.service.department.api.IDepartmentService;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * <p>
 * 客户表
 * </p>
 *
 * @author yangwei
 * @since 2020-09-14
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="客户数据响应对象")
public class CustomerVo extends BaseIdVo<String> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "客户编号，唯一")
    private String code;

    @ApiModelProperty(value = " 称呼")
    private String appellation;

    @ApiModelProperty(value = "姓名，真实姓名")
    private String name;

    @ApiModelProperty(value = "头像，图片绝对路径")
    private String avatar;

    @ApiModelProperty(value = "性别，字典id")
    private String genderDictId;

    @TransBy(type = IDictService.trans_dictName,byFieldName = "genderDictId")
    @ApiModelProperty(value = "性别，字典名称")
    private String genderDictName;

    @ApiModelProperty(value = "年龄")
    private Integer age;

    @ApiModelProperty(value = "出生年月日")
    private Date birthDay;

    @TransBy(type = DatetimeTransServiceImpl.trans_date,byFieldName = "birthDay")
    @ApiModelProperty(value = "出生年月日")
    private Date birthDayTxt;

    @ApiModelProperty(value = "客户所在公司id")
    private String companyId;

    @TransBy(type = ICompanyService.trans_company_name,byFieldName = "companyId")
    @ApiModelProperty(value = "客户所在公司名称")
    private String companyName;

    @ApiModelProperty(value = "客户所在部门id")
    private String departmentId;

    @TransBy(type = IDepartmentService.trans_department_name,byFieldName = "departmentId")
    @ApiModelProperty(value = "客户所在部门名称")
    private String departmentName;

    @ApiModelProperty(value = "黑名单状态，0=正常；1=黑名单")
    private Boolean isBlack;

    @ApiModelProperty(value = "黑名单原因")
    private String blackReason;

    @ApiModelProperty(value = "客户分类，字典")
    private String categoryDictId;

    @TransBy(type = IDictService.trans_dictName,byFieldName = "categoryDictId")
    @ApiModelProperty(value = "客户分类，字典名称")
    private String categoryDictName;

    @ApiModelProperty(value = "唯一id，有可能不同的客户数据其实是同一个客户，这里唯一标识，默认为主键id")
    private String unionId;

    @TransField
    @ApiModelProperty(value = "客户来源描述")
    private CustomerBelongVo customerBelong;
}
